zGlobal = {};
zUtil = {};
zCode = {};
zMsg = {};
zApi = {};
zConst = {};
zMenu = {'menu':[]};
zCheck = {};
zDictSys = {};
zDictAutocode = {};
zDictDesign = {};

zConst['alldict'] ="alldict";
zConst['busCode'] ="busCode";
zConst['busMsg'] ="busMsg";
zConst['reqData'] ="reqData";
zConst['resData'] ="resData";
zConst['data'] = "data";
zConst['count'] ="count";
zConst['page'] ="page";
zConst['rows'] ="limit";
zConst['sort'] ="sort";
zConst['order'] ="order";
zConst['token'] = "myToken";

zCode['GLOBAL_SUCCESS'] ="global_success";
zMsg['GLOBAL_SUCCESS'] ="成功";
 
function setHttp(httpStr){
    $.localStorage('http', httpStr);
}
function getHttp(){
    return $.localStorage('http');
}
function setToken(token){
    $.sessionStorage(zConst['token'], token);
}
function getToken(){
    return $.sessionStorage(zConst['token']);
}
function delToken(){
    return $.sessionStorage.remove(zConst['token']);
}
function getHeaderToken(){
    var headerVO = {};
    try{
        var chref = window.location.href;
        var p=zUtil.getUrlParams();
        if(p[zConst['token']]){
            setToken(p[zConst['token']]);
        }
        var token = getToken();
        if(!token || token.length<1){
           setToken("errortoken");
           if(chref.indexOf('/login') == -1 && zGlobal['http2']){
               var httpStr=$.localStorage('http');
               if(httpStr){
                   window.top.location.replace(httpStr + "/page/login");
               }else{
                   window.top.location.replace(zGlobal['http2'] + "/page/login.html");
               }
           }
           return;
        }else{
           headerVO[zConst['token']] = encodeURIComponent(token);
        }
    }catch(b){
        console.log(b);
    }
    return headerVO;
}

zMenu['menu'].push({
    text: '代码生成',
    iconCls: 'fa fa-cog  fa-1',
    state : 'open',
    //selected: true,
    children: [{
        text: '项目信息',
        id: 'ZL_PROJECT',
        href: './autocode/project/projectIndex.html',
        title: '项目信息',
    }, {
        text: '模板信息',
        id: 'ZL_TEMPLATE',
        href: './autocode/template/templateIndex.html',
        title: '模板信息',
    }, {
        text: '代码生成配置',
        id: 'ZL_CONFIGGENERATE',
        href: './autocode/cfgGenerate/cfgGenerateIndex.html',
        title: '代码生成配置',
    }, {
        text: '校验规则',
        id: 'ZL_VALIDATION',
        href: './autocode/validation/validationIndex.html',
        title: '校验规则',
    }, {
        text : '前端组件',
        id : 'ZL_WEBCOMPONENT',
        href:'./autocode/webComponent/webComponentIndex.html',
        title : '前端组件',
    }, {
        text: '字典',
        id: 'ZL_DICT',
        href: './autocode/dict/dictIndex.html',
        title: '字典',
    }, {
        text: '字段映射',
        id: 'ZL_FIELDMAPPING',
        href: './autocode/fieldMapping/fieldMappingIndex.html',
        title: '字段映射',
    }, {
        text: '数据库关键字',
        id: 'ZL_KEYWORD',
        href: './autocode/keyword/keywordIndex.html',
        title: '数据库关键字',
    }, {
        text: '数据库表',
        id: 'ZL_TABLE',
        href: './autocode/table/tableIndex.html',
        title: '数据库表',
    },{
        text : '在线SQL',
        id : 'ZL_ONLINESQL',
        href:'./autocode/sql/generatorSqlQuery.html',
        title : '在线SQL',
    },
    {
        text: 'ddl模板',
        href: './autocode/ddlTemplate/ddlTemplateIndex.html',
        id:'ZL_DDLTEMPLATE',
        title: 'ddl模板',
    },
    {
        text: '可视化模板',
        href: './autocode/previewTemplate/previewTemplateIndex.html',
        id:'ZL_PREVIEWTEMPLATE',
        title: '可视化模板',
    },
    /*, {
        text: '数据库序号(暂无用)',
        id: 'ZL_TABLESEQUENCE',
        href: './autocode/tableSequence/tableSequenceIndex.html',
        title: '数据库序号',
    }*/]
});